package chpt04.abstractshapes;

public abstract class AbstractShape {
	private int x;
	private int y;
	private int id;
	
	public AbstractShape() {
		id = 0;
		x = 0;
		y = 0;
		
		
	}
	public AbstractShape(int x, int y, int id) {
		this.x = x;
		this.y = y;
		this.id = id;
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	public abstract double getArea();
	
	public abstract double getPerimeter();
	
	public static double sum(AbstractShape[] shapes) {
		double x = 0.0;
		for (AbstractShape e : shapes) {
			x += e.getArea();
		}
		return x;
	}

}
